package MULE.Model.Panel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

import MULE.Model.Logic.PubLogic;

public class PubPanel extends JPanel {

	private JButton exitPub, gambleButton;

	public PubPanel(Dimension panelSize) {
		// init
		this.setPreferredSize(panelSize);
		this.setBackground(new Color(13, 87, 0));
		exitPub = new JButton("Back to Town");
		exitPub.setActionCommand(PubLogic.ActionCommand.EXIT_PUB.toString());
		this.add(exitPub);
		// Add in a gamble button
		gambleButton = new JButton("Gamble");
		gambleButton.setActionCommand(PubLogic.ActionCommand.GAMBLE.toString());
		this.add(gambleButton);
	}

	/**
	 * Adds the given action listener to the panel's exit button.
	 * 
	 * @param listener
	 *            The exit button's new listener.
	 */
	public void addExitButtonListener(ActionListener listener) {
		exitPub.addActionListener(listener);
	}

	/**
	 * Adds the given action listener to the panel's gamble button.
	 * 
	 * @param listener
	 *            The gamble button's new listener.
	 */
	public void addGambleListener(ActionListener listener) {
		gambleButton.addActionListener(listener);
	}
}
